#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    vector<int> transformArray(vector<int> &nums)
    {
        vector<int> ans;
        int a = 0, b = 0;
        for (auto &num : nums)
        {
            (num & 1) ? a++ : b++;
        }
        while (b--)
        {
            ans.push_back(0);
        }
        while (a--)
        {
            ans.push_back(1);
        }
        return ans;
    }
};
